package com.sinothk.base.serialNumber.controller;

import com.sinothk.base.serialNumber.domain.vo.SerialNumberVO;
import com.sinothk.base.serialNumber.manager.SerialNumberHelper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "序列号")
@RestController
@RequestMapping("/comm/serialNumberCtrl")
public class SerialNumberController {

    @AutoLog(value = "序列号-获取")
    @ApiOperation(value = "序列号-获取", notes = "序列号-获取")
    @GetMapping("/getSerialNumber")
    public Result<?> getSerialNumber(@RequestParam("type") String type) {
        SerialNumberVO serialNumberVO = new SerialNumberVO();
        String serialNumber = SerialNumberHelper.getSerialNumber(type);
        serialNumberVO.setSerialNumber(serialNumber);
        serialNumberVO.setBizId(SerialNumberHelper.getSerialNumber());
        return Result.OK(serialNumberVO);
    }

}
